<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>

<s:layout-render name="/frontend/layout.jsp" title="frontend.hotelsList.title">
    <s:layout-component name="body">
        <s:useActionBean beanclass="cz.muni.fi.pa165.bookingmanager.web.FrontEndActionBean" var="actionBean"/>
        <div class="content_right_section">              
            <div class="content_title_01"><c:out value="${actionBean.hotel.name}" /></div>            
            <h3><f:message key="frontend.global.address" />: ${actionBean.hotel.adress}, ${actionBean.hotel.city}</h3>
            <p>${actionBean.hotel.description}</p>            
            <div class="cleaner_h20">&nbsp;</div>
            <hr />
            
            <br />
            <h3><f:message key="frontend.hotelDetail.availability_search" /></h3>
            <br />
            <s:form action="/frontend/hotelFreeRooms" method="post">  
                <s:hidden name="hotel.id" value="${actionBean.hotel.id}" />                
                <table width="100%">
                    <tr>
                        <th><f:message key="frontend.global.arrival" /></th>
                        <td>
                            <s:select name="day">
                                <% for(int i = 1; i <= 31; i++ ){ %> 
                                <s:option value="<%= i %>" ><%= i %></s:option>
                                <% } %>
                            </s:select>                            
                            <s:select name="month">
                                <% for(int i = 1; i <= 12; i++ ){ %> 
                                <s:option value="<%= i %>" ><%= i %></s:option>
                                <% } %>
                            </s:select>
                            <s:select name="year">
                                <% for(int i = 2012; i <= 2030; i++ ){ %> 
                                <s:option value="<%= i %>" ><%= i %></s:option>
                                <% } %>
                            </s:select>                            
                        </td>
                    </tr>
                    <tr>
                        <th><f:message key="entities.reservation.duration" /></th>
                        <td>
                            <s:text name="duration" />
                            <s:errors field="duration">
                            <s:errors-header><ul></s:errors-header>
                            <li><s:individual-error /></li>
                            <s:errors-footer></ul></s:errors-footer>
                            </s:errors>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center"><br /><s:submit name="hotelFreeRooms" ><f:message key="global.submit" /></s:submit></td>
                    </tr>
                </table>                    
            </s:form>
                            
       	</div>
        <div class="cleaner_h40">&nbsp;</div>
        
        
    </s:layout-component>
</s:layout-render>

